package com.aw.baselib.base

import android.os.Bundle

/**
 * Created by hzw
 */
abstract class AwMvpLazyFragment<T : AwCommonPresenter?> : AwBaseLazyFragment() {
    protected var mPresenter: T? = null
    protected abstract fun createPresenter(): T
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        mPresenter = createPresenter()
        if (null != mPresenter) {
            mPresenter!!.attachView()
        }
    }

    override fun onDestroy() {
        super.onDestroy()
        if (null != mPresenter) {
            mPresenter!!.detachView()
        }
    }
}